package demo8;

import org.springframework.context.annotation.AnnotationConfigApplicationContext;

import java.sql.Connection;

public class Demo {
    public static void main(String[] args) throws Exception {
        AnnotationConfigApplicationContext contest=
                new AnnotationConfigApplicationContext(Config.class);
        Person person=contest.getBean(Person.class);
        System.out.println(person);
        Student student=contest.getBean(Student.class);
        System.out.println(student);

        DBUtil  dbutil=contest.getBean(DBUtil.class);
        Connection conn= dbutil.getConnection();
        System.out.println(conn);





    }
}
